﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;
using System.Windows;

namespace Sinacor.Infra.UI.Controls.SmartClient
{
    public class SinacorMenuItemDataTemplateSelector : DataTemplateSelector
    {
        private DataTemplate ControlMenuItem;
        public DataTemplate ControlMenuItemDataTemplate
        {
            get { return ControlMenuItem; }
            set { ControlMenuItem = value; }
        }

        private DataTemplate ControlMenuItemSeparator;
        public DataTemplate ControlMenuItemSeparatorDataTemplate
        {
            get { return ControlMenuItemSeparator; }
            set { ControlMenuItemSeparator = value; }
        }

        public override DataTemplate SelectTemplate(object item, DependencyObject container)
        {
            if (item is SinacorMenuItemSeparator)
                return ControlMenuItemSeparator;

            return ControlMenuItem;
        }
    }
}
